3.3 \(\int \frac {(A+B x) (a+b x+c x^2)^3}{d+f x^2} \, dx\)

Optimal. Leaf size=441 \[ \frac {\log \left (d+f x^2\right ) \left (A b f \left (-f \left (b^2 d-3 a^2 f\right )-6 a c d f+3 c^2 d^2\right )-B (c d-a f) \left (-f \left (3 b^2 d-a^2 f\right )-2 a c d f+c^2 d^2\right )\right )}{2 f^4}-\frac {x^2 \left (A b f \left (-6 a c f+b^2 (-f)+3 c^2 d\right )-B \left (-3 c f \left (b^2 d-a^2 f\right )+3 a b^2 f^2-3 a c^2 d f+c^3 d^2\right )\right )}{2 f^3}-\frac {x \left (-A c \left (3 a^2 f^2-3 a c d f+c^2 d^2\right )+3 A b^2 f (c d-a f)-3 b B (c d-a f)^2+b^3 B d f\right )}{f^3}+\frac {c x^4 \left (3 A b c f-B \left (-3 a c f-3 b^2 f+c^2 d\right )\right )}{4 f^2}+\frac {x^3 \left (-A c^2 (c d-3 a f)-3 b B c (c d-2 a f)+3 A b^2 c f+b^3 B f\right )}{3 f^2}+\frac {\tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {d}}\right ) \left (3 A b^2 d f (c d-a f)-A (c d-a f)^3-3 b B d (c d-a f)^2+b^3 B d^2 f\right )}{\sqrt {d} f^{7/2}}+\frac {c^2 x^5 (A c+3 b B)}{5 f}+\frac {B c^3 x^6}{6 f} \]

[Out]

-(b^3*B*d*f+3*A*b^2*f*(-a*f+c*d)-3*b*B*(-a*f+c*d)^2-A*c*(3*a^2*f^2-3*a*c*d*f+c^2*d^2))*x/f^3-1/2*(A*b*f*(-6*a*
c*f-b^2*f+3*c^2*d)-B*(c^3*d^2-3*a*c^2*d*f+3*a*b^2*f^2-3*c*f*(-a^2*f+b^2*d)))*x^2/f^3+1/3*(b^3*B*f+3*A*b^2*c*f-
A*c^2*(-3*a*f+c*d)-3*b*B*c*(-2*a*f+c*d))*x^3/f^2+1/4*c*(3*A*b*c*f-B*(-3*a*c*f-3*b^2*f+c^2*d))*x^4/f^2+1/5*c^2*
(A*c+3*B*b)*x^5/f+1/6*B*c^3*x^6/f+1/2*(A*b*f*(3*c^2*d^2-6*a*c*d*f-f*(-3*a^2*f+b^2*d))-B*(-a*f+c*d)*(c^2*d^2-2*
a*c*d*f-f*(-a^2*f+3*b^2*d)))*ln(f*x^2+d)/f^4+(b^3*B*d^2*f+3*A*b^2*d*f*(-a*f+c*d)-3*b*B*d*(-a*f+c*d)^2-A*(-a*f+
c*d)^3)*arctan(x*f^(1/2)/d^(1/2))/f^(7/2)/d^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.62, antiderivative size = 441, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {1012, 635, 205, 260} \[ -\frac {x^2 \left (A b f \left (-6 a c f+b^2 (-f)+3 c^2 d\right )-B \left (-3 c f \left (b^2 d-a^2 f\right )+3 a b^2 f^2-3 a c^2 d f+c^3 d^2\right )\right )}{2 f^3}+\frac {\log \left (d+f x^2\right ) \left (A b f \left (-f \left (b^2 d-3 a^2 f\right )-6 a c d f+3 c^2 d^2\right )-B (c d-a f) \left (-f \left (3 b^2 d-a^2 f\right )-2 a c d f+c^2 d^2\right )\right )}{2 f^4}-\frac {x \left (-A c \left (3 a^2 f^2-3 a c d f+c^2 d^2\right )+3 A b^2 f (c d-a f)-3 b B (c d-a f)^2+b^3 B d f\right )}{f^3}+\frac {c x^4 \left (3 A b c f-B \left (-3 a c f-3 b^2 f+c^2 d\right )\right )}{4 f^2}+\frac {x^3 \left (-A c^2 (c d-3 a f)-3 b B c (c d-2 a f)+3 A b^2 c f+b^3 B f\right )}{3 f^2}+\frac {\tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {d}}\right ) \left (3 A b^2 d f (c d-a f)-A (c d-a f)^3-3 b B d (c d-a f)^2+b^3 B d^2 f\right )}{\sqrt {d} f^{7/2}}+\frac {c^2 x^5 (A c+3 b B)}{5 f}+\frac {B c^3 x^6}{6 f} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*x)*(a + b*x + c*x^2)^3)/(d + f*x^2),x]

[Out]

-(((b^3*B*d*f + 3*A*b^2*f*(c*d - a*f) - 3*b*B*(c*d - a*f)^2 - A*c*(c^2*d^2 - 3*a*c*d*f + 3*a^2*f^2))*x)/f^3) -
 ((A*b*f*(3*c^2*d - b^2*f - 6*a*c*f) - B*(c^3*d^2 - 3*a*c^2*d*f + 3*a*b^2*f^2 - 3*c*f*(b^2*d - a^2*f)))*x^2)/(
2*f^3) + ((b^3*B*f + 3*A*b^2*c*f - A*c^2*(c*d - 3*a*f) - 3*b*B*c*(c*d - 2*a*f))*x^3)/(3*f^2) + (c*(3*A*b*c*f -
 B*(c^2*d - 3*b^2*f - 3*a*c*f))*x^4)/(4*f^2) + (c^2*(3*b*B + A*c)*x^5)/(5*f) + (B*c^3*x^6)/(6*f) + ((b^3*B*d^2
*f + 3*A*b^2*d*f*(c*d - a*f) - 3*b*B*d*(c*d - a*f)^2 - A*(c*d - a*f)^3)*ArcTan[(Sqrt[f]*x)/Sqrt[d]])/(Sqrt[d]*
f^(7/2)) + ((A*b*f*(3*c^2*d^2 - 6*a*c*d*f - f*(b^2*d - 3*a^2*f)) - B*(c*d - a*f)*(c^2*d^2 - 2*a*c*d*f - f*(3*b
^2*d - a^2*f)))*Log[d + f*x^2])/(2*f^4)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 1012

Int[((g_.) + (h_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_)*((d_) + (e_.)*(x_) + (f_.)*(x_)^2)^(q_), x_Symbol] :> Int[
ExpandIntegrand[(a + c*x^2)^p*(d + e*x + f*x^2)^q*(g + h*x), x], x] /; FreeQ[{a, c, d, e, f, g, h}, x] && NeQ[
e^2 - 4*d*f, 0] && IntegersQ[p, q] && (GtQ[p, 0] || GtQ[q, 0])

Rubi steps

\begin {align*} \int \frac {(A+B x) \left (a+b x+c x^2\right )^3}{d+f x^2} \, dx &=\int \left (-\frac {b^3 B d f+3 A b^2 f (c d-a f)-3 b B (c d-a f)^2-A c \left (c^2 d^2-3 a c d f+3 a^2 f^2\right )}{f^3}-\frac {\left (A b f \left (3 c^2 d-b^2 f-6 a c f\right )-B \left (c^3 d^2-3 a c^2 d f+3 a b^2 f^2-3 c f \left (b^2 d-a^2 f\right )\right )\right ) x}{f^3}+\frac {\left (b^3 B f+3 A b^2 c f-A c^2 (c d-3 a f)-3 b B c (c d-2 a f)\right ) x^2}{f^2}+\frac {c \left (3 A b c f-B \left (c^2 d-3 b^2 f-3 a c f\right )\right ) x^3}{f^2}+\frac {c^2 (3 b B+A c) x^4}{f}+\frac {B c^3 x^5}{f}-\frac {-b^3 B d^2 f-3 A b^2 d f (c d-a f)+3 b B d (c d-a f)^2+A (c d-a f)^3-\left (A b f \left (3 c^2 d^2-6 a c d f-f \left (b^2 d-3 a^2 f\right )\right )-B (c d-a f) \left (c^2 d^2-2 a c d f-f \left (3 b^2 d-a^2 f\right )\right )\right ) x}{f^3 \left (d+f x^2\right )}\right ) \, dx\\ &=-\frac {\left (b^3 B d f+3 A b^2 f (c d-a f)-3 b B (c d-a f)^2-A c \left (c^2 d^2-3 a c d f+3 a^2 f^2\right )\right ) x}{f^3}-\frac {\left (A b f \left (3 c^2 d-b^2 f-6 a c f\right )-B \left (c^3 d^2-3 a c^2 d f+3 a b^2 f^2-3 c f \left (b^2 d-a^2 f\right )\right )\right ) x^2}{2 f^3}+\frac {\left (b^3 B f+3 A b^2 c f-A c^2 (c d-3 a f)-3 b B c (c d-2 a f)\right ) x^3}{3 f^2}+\frac {c \left (3 A b c f-B \left (c^2 d-3 b^2 f-3 a c f\right )\right ) x^4}{4 f^2}+\frac {c^2 (3 b B+A c) x^5}{5 f}+\frac {B c^3 x^6}{6 f}-\frac {\int \frac {-b^3 B d^2 f-3 A b^2 d f (c d-a f)+3 b B d (c d-a f)^2+A (c d-a f)^3-\left (A b f \left (3 c^2 d^2-6 a c d f-f \left (b^2 d-3 a^2 f\right )\right )-B (c d-a f) \left (c^2 d^2-2 a c d f-f \left (3 b^2 d-a^2 f\right )\right )\right ) x}{d+f x^2} \, dx}{f^3}\\ &=-\frac {\left (b^3 B d f+3 A b^2 f (c d-a f)-3 b B (c d-a f)^2-A c \left (c^2 d^2-3 a c d f+3 a^2 f^2\right )\right ) x}{f^3}-\frac {\left (A b f \left (3 c^2 d-b^2 f-6 a c f\right )-B \left (c^3 d^2-3 a c^2 d f+3 a b^2 f^2-3 c f \left (b^2 d-a^2 f\right )\right )\right ) x^2}{2 f^3}+\frac {\left (b^3 B f+3 A b^2 c f-A c^2 (c d-3 a f)-3 b B c (c d-2 a f)\right ) x^3}{3 f^2}+\frac {c \left (3 A b c f-B \left (c^2 d-3 b^2 f-3 a c f\right )\right ) x^4}{4 f^2}+\frac {c^2 (3 b B+A c) x^5}{5 f}+\frac {B c^3 x^6}{6 f}+\frac {\left (b^3 B d^2 f+3 A b^2 d f (c d-a f)-3 b B d (c d-a f)^2-A (c d-a f)^3\right ) \int \frac {1}{d+f x^2} \, dx}{f^3}+\frac {\left (A b f \left (3 c^2 d^2-6 a c d f-f \left (b^2 d-3 a^2 f\right )\right )-B (c d-a f) \left (c^2 d^2-2 a c d f-f \left (3 b^2 d-a^2 f\right )\right )\right ) \int \frac {x}{d+f x^2} \, dx}{f^3}\\ &=-\frac {\left (b^3 B d f+3 A b^2 f (c d-a f)-3 b B (c d-a f)^2-A c \left (c^2 d^2-3 a c d f+3 a^2 f^2\right )\right ) x}{f^3}-\frac {\left (A b f \left (3 c^2 d-b^2 f-6 a c f\right )-B \left (c^3 d^2-3 a c^2 d f+3 a b^2 f^2-3 c f \left (b^2 d-a^2 f\right )\right )\right ) x^2}{2 f^3}+\frac {\left (b^3 B f+3 A b^2 c f-A c^2 (c d-3 a f)-3 b B c (c d-2 a f)\right ) x^3}{3 f^2}+\frac {c \left (3 A b c f-B \left (c^2 d-3 b^2 f-3 a c f\right )\right ) x^4}{4 f^2}+\frac {c^2 (3 b B+A c) x^5}{5 f}+\frac {B c^3 x^6}{6 f}+\frac {\left (b^3 B d^2 f+3 A b^2 d f (c d-a f)-3 b B d (c d-a f)^2-A (c d-a f)^3\right ) \tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {d}}\right )}{\sqrt {d} f^{7/2}}+\frac {\left (A b f \left (3 c^2 d^2-6 a c d f-f \left (b^2 d-3 a^2 f\right )\right )-B (c d-a f) \left (c^2 d^2-2 a c d f-f \left (3 b^2 d-a^2 f\right )\right )\right ) \log \left (d+f x^2\right )}{2 f^4}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.46, size = 422, normalized size = 0.96 \[ \frac {f x \left (3 b \left (4 B \left (15 a^2 f^2+10 a c f \left (f x^2-3 d\right )+c^2 \left (15 d^2-5 d f x^2+3 f^2 x^4\right )\right )+15 A c f x \left (4 a f-2 c d+c f x^2\right )\right )+c \left (4 A \left (45 a^2 f^2+15 a c f \left (f x^2-3 d\right )+c^2 \left (15 d^2-5 d f x^2+3 f^2 x^4\right )\right )+5 B x \left (18 a^2 f^2+9 a c f \left (f x^2-2 d\right )+c^2 \left (6 d^2-3 d f x^2+2 f^2 x^4\right )\right )\right )+15 b^2 f \left (4 A \left (3 a f-3 c d+c f x^2\right )+3 B x \left (2 a f-2 c d+c f x^2\right )\right )+10 b^3 f \left (3 A f x-6 B d+2 B f x^2\right )\right )-30 \log \left (d+f x^2\right ) \left (A b f \left (-3 a^2 f^2+6 a c d f+b^2 d f-3 c^2 d^2\right )+B (c d-a f) \left (a^2 f^2-2 a c d f-3 b^2 d f+c^2 d^2\right )\right )}{60 f^4}+\frac {\tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {d}}\right ) \left (3 A b^2 d f (c d-a f)-A (c d-a f)^3-3 b B d (c d-a f)^2+b^3 B d^2 f\right )}{\sqrt {d} f^{7/2}} \]

Antiderivative was successfully verified.

[In]

Integrate[((A + B*x)*(a + b*x + c*x^2)^3)/(d + f*x^2),x]

[Out]

((b^3*B*d^2*f + 3*A*b^2*d*f*(c*d - a*f) - 3*b*B*d*(c*d - a*f)^2 - A*(c*d - a*f)^3)*ArcTan[(Sqrt[f]*x)/Sqrt[d]]
)/(Sqrt[d]*f^(7/2)) + (f*x*(10*b^3*f*(-6*B*d + 3*A*f*x + 2*B*f*x^2) + 15*b^2*f*(3*B*x*(-2*c*d + 2*a*f + c*f*x^
2) + 4*A*(-3*c*d + 3*a*f + c*f*x^2)) + 3*b*(15*A*c*f*x*(-2*c*d + 4*a*f + c*f*x^2) + 4*B*(15*a^2*f^2 + 10*a*c*f
*(-3*d + f*x^2) + c^2*(15*d^2 - 5*d*f*x^2 + 3*f^2*x^4))) + c*(5*B*x*(18*a^2*f^2 + 9*a*c*f*(-2*d + f*x^2) + c^2
*(6*d^2 - 3*d*f*x^2 + 2*f^2*x^4)) + 4*A*(45*a^2*f^2 + 15*a*c*f*(-3*d + f*x^2) + c^2*(15*d^2 - 5*d*f*x^2 + 3*f^
2*x^4)))) - 30*(A*b*f*(-3*c^2*d^2 + b^2*d*f + 6*a*c*d*f - 3*a^2*f^2) + B*(c*d - a*f)*(c^2*d^2 - 3*b^2*d*f - 2*
a*c*d*f + a^2*f^2))*Log[d + f*x^2])/(60*f^4)

________________________________________________________________________________________

fricas [A]  time = 0.71, size = 1014, normalized size = 2.30 \[ \left [\frac {10 \, B c^{3} d f^{3} x^{6} + 12 \, {\left (3 \, B b c^{2} + A c^{3}\right )} d f^{3} x^{5} - 15 \, {\left (B c^{3} d^{2} f^{2} - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} d f^{3}\right )} x^{4} - 20 \, {\left ({\left (3 \, B b c^{2} + A c^{3}\right )} d^{2} f^{2} - {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} d f^{3}\right )} x^{3} + 30 \, {\left (B c^{3} d^{3} f - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} d^{2} f^{2} + {\left (3 \, B a b^{2} + A b^{3} + 3 \, {\left (B a^{2} + 2 \, A a b\right )} c\right )} d f^{3}\right )} x^{2} - 30 \, {\left (A a^{3} f^{3} - {\left (3 \, B b c^{2} + A c^{3}\right )} d^{3} + {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} d^{2} f - 3 \, {\left (B a^{2} b + A a b^{2} + A a^{2} c\right )} d f^{2}\right )} \sqrt {-d f} \log \left (\frac {f x^{2} - 2 \, \sqrt {-d f} x - d}{f x^{2} + d}\right ) + 60 \, {\left ({\left (3 \, B b c^{2} + A c^{3}\right )} d^{3} f - {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} d^{2} f^{2} + 3 \, {\left (B a^{2} b + A a b^{2} + A a^{2} c\right )} d f^{3}\right )} x - 30 \, {\left (B c^{3} d^{4} - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} d^{3} f + {\left (3 \, B a b^{2} + A b^{3} + 3 \, {\left (B a^{2} + 2 \, A a b\right )} c\right )} d^{2} f^{2} - {\left (B a^{3} + 3 \, A a^{2} b\right )} d f^{3}\right )} \log \left (f x^{2} + d\right )}{60 \, d f^{4}}, \frac {10 \, B c^{3} d f^{3} x^{6} + 12 \, {\left (3 \, B b c^{2} + A c^{3}\right )} d f^{3} x^{5} - 15 \, {\left (B c^{3} d^{2} f^{2} - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} d f^{3}\right )} x^{4} - 20 \, {\left ({\left (3 \, B b c^{2} + A c^{3}\right )} d^{2} f^{2} - {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} d f^{3}\right )} x^{3} + 30 \, {\left (B c^{3} d^{3} f - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} d^{2} f^{2} + {\left (3 \, B a b^{2} + A b^{3} + 3 \, {\left (B a^{2} + 2 \, A a b\right )} c\right )} d f^{3}\right )} x^{2} + 60 \, {\left (A a^{3} f^{3} - {\left (3 \, B b c^{2} + A c^{3}\right )} d^{3} + {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} d^{2} f - 3 \, {\left (B a^{2} b + A a b^{2} + A a^{2} c\right )} d f^{2}\right )} \sqrt {d f} \arctan \left (\frac {\sqrt {d f} x}{d}\right ) + 60 \, {\left ({\left (3 \, B b c^{2} + A c^{3}\right )} d^{3} f - {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} d^{2} f^{2} + 3 \, {\left (B a^{2} b + A a b^{2} + A a^{2} c\right )} d f^{3}\right )} x - 30 \, {\left (B c^{3} d^{4} - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} d^{3} f + {\left (3 \, B a b^{2} + A b^{3} + 3 \, {\left (B a^{2} + 2 \, A a b\right )} c\right )} d^{2} f^{2} - {\left (B a^{3} + 3 \, A a^{2} b\right )} d f^{3}\right )} \log \left (f x^{2} + d\right )}{60 \, d f^{4}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^3/(f*x^2+d),x, algorithm="fricas")

[Out]

[1/60*(10*B*c^3*d*f^3*x^6 + 12*(3*B*b*c^2 + A*c^3)*d*f^3*x^5 - 15*(B*c^3*d^2*f^2 - 3*(B*b^2*c + (B*a + A*b)*c^
2)*d*f^3)*x^4 - 20*((3*B*b*c^2 + A*c^3)*d^2*f^2 - (B*b^3 + 3*A*a*c^2 + 3*(2*B*a*b + A*b^2)*c)*d*f^3)*x^3 + 30*
(B*c^3*d^3*f - 3*(B*b^2*c + (B*a + A*b)*c^2)*d^2*f^2 + (3*B*a*b^2 + A*b^3 + 3*(B*a^2 + 2*A*a*b)*c)*d*f^3)*x^2
- 30*(A*a^3*f^3 - (3*B*b*c^2 + A*c^3)*d^3 + (B*b^3 + 3*A*a*c^2 + 3*(2*B*a*b + A*b^2)*c)*d^2*f - 3*(B*a^2*b + A
*a*b^2 + A*a^2*c)*d*f^2)*sqrt(-d*f)*log((f*x^2 - 2*sqrt(-d*f)*x - d)/(f*x^2 + d)) + 60*((3*B*b*c^2 + A*c^3)*d^
3*f - (B*b^3 + 3*A*a*c^2 + 3*(2*B*a*b + A*b^2)*c)*d^2*f^2 + 3*(B*a^2*b + A*a*b^2 + A*a^2*c)*d*f^3)*x - 30*(B*c
^3*d^4 - 3*(B*b^2*c + (B*a + A*b)*c^2)*d^3*f + (3*B*a*b^2 + A*b^3 + 3*(B*a^2 + 2*A*a*b)*c)*d^2*f^2 - (B*a^3 +
3*A*a^2*b)*d*f^3)*log(f*x^2 + d))/(d*f^4), 1/60*(10*B*c^3*d*f^3*x^6 + 12*(3*B*b*c^2 + A*c^3)*d*f^3*x^5 - 15*(B
*c^3*d^2*f^2 - 3*(B*b^2*c + (B*a + A*b)*c^2)*d*f^3)*x^4 - 20*((3*B*b*c^2 + A*c^3)*d^2*f^2 - (B*b^3 + 3*A*a*c^2
 + 3*(2*B*a*b + A*b^2)*c)*d*f^3)*x^3 + 30*(B*c^3*d^3*f - 3*(B*b^2*c + (B*a + A*b)*c^2)*d^2*f^2 + (3*B*a*b^2 +
A*b^3 + 3*(B*a^2 + 2*A*a*b)*c)*d*f^3)*x^2 + 60*(A*a^3*f^3 - (3*B*b*c^2 + A*c^3)*d^3 + (B*b^3 + 3*A*a*c^2 + 3*(
2*B*a*b + A*b^2)*c)*d^2*f - 3*(B*a^2*b + A*a*b^2 + A*a^2*c)*d*f^2)*sqrt(d*f)*arctan(sqrt(d*f)*x/d) + 60*((3*B*
b*c^2 + A*c^3)*d^3*f - (B*b^3 + 3*A*a*c^2 + 3*(2*B*a*b + A*b^2)*c)*d^2*f^2 + 3*(B*a^2*b + A*a*b^2 + A*a^2*c)*d
*f^3)*x - 30*(B*c^3*d^4 - 3*(B*b^2*c + (B*a + A*b)*c^2)*d^3*f + (3*B*a*b^2 + A*b^3 + 3*(B*a^2 + 2*A*a*b)*c)*d^
2*f^2 - (B*a^3 + 3*A*a^2*b)*d*f^3)*log(f*x^2 + d))/(d*f^4)]

________________________________________________________________________________________

giac [A]  time = 0.16, size = 623, normalized size = 1.41 \[ -\frac {{\left (3 \, B b c^{2} d^{3} + A c^{3} d^{3} - B b^{3} d^{2} f - 6 \, B a b c d^{2} f - 3 \, A b^{2} c d^{2} f - 3 \, A a c^{2} d^{2} f + 3 \, B a^{2} b d f^{2} + 3 \, A a b^{2} d f^{2} + 3 \, A a^{2} c d f^{2} - A a^{3} f^{3}\right )} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f} f^{3}} - \frac {{\left (B c^{3} d^{3} - 3 \, B b^{2} c d^{2} f - 3 \, B a c^{2} d^{2} f - 3 \, A b c^{2} d^{2} f + 3 \, B a b^{2} d f^{2} + A b^{3} d f^{2} + 3 \, B a^{2} c d f^{2} + 6 \, A a b c d f^{2} - B a^{3} f^{3} - 3 \, A a^{2} b f^{3}\right )} \log \left (f x^{2} + d\right )}{2 \, f^{4}} + \frac {10 \, B c^{3} f^{5} x^{6} + 36 \, B b c^{2} f^{5} x^{5} + 12 \, A c^{3} f^{5} x^{5} - 15 \, B c^{3} d f^{4} x^{4} + 45 \, B b^{2} c f^{5} x^{4} + 45 \, B a c^{2} f^{5} x^{4} + 45 \, A b c^{2} f^{5} x^{4} - 60 \, B b c^{2} d f^{4} x^{3} - 20 \, A c^{3} d f^{4} x^{3} + 20 \, B b^{3} f^{5} x^{3} + 120 \, B a b c f^{5} x^{3} + 60 \, A b^{2} c f^{5} x^{3} + 60 \, A a c^{2} f^{5} x^{3} + 30 \, B c^{3} d^{2} f^{3} x^{2} - 90 \, B b^{2} c d f^{4} x^{2} - 90 \, B a c^{2} d f^{4} x^{2} - 90 \, A b c^{2} d f^{4} x^{2} + 90 \, B a b^{2} f^{5} x^{2} + 30 \, A b^{3} f^{5} x^{2} + 90 \, B a^{2} c f^{5} x^{2} + 180 \, A a b c f^{5} x^{2} + 180 \, B b c^{2} d^{2} f^{3} x + 60 \, A c^{3} d^{2} f^{3} x - 60 \, B b^{3} d f^{4} x - 360 \, B a b c d f^{4} x - 180 \, A b^{2} c d f^{4} x - 180 \, A a c^{2} d f^{4} x + 180 \, B a^{2} b f^{5} x + 180 \, A a b^{2} f^{5} x + 180 \, A a^{2} c f^{5} x}{60 \, f^{6}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^3/(f*x^2+d),x, algorithm="giac")

[Out]

-(3*B*b*c^2*d^3 + A*c^3*d^3 - B*b^3*d^2*f - 6*B*a*b*c*d^2*f - 3*A*b^2*c*d^2*f - 3*A*a*c^2*d^2*f + 3*B*a^2*b*d*
f^2 + 3*A*a*b^2*d*f^2 + 3*A*a^2*c*d*f^2 - A*a^3*f^3)*arctan(f*x/sqrt(d*f))/(sqrt(d*f)*f^3) - 1/2*(B*c^3*d^3 -
3*B*b^2*c*d^2*f - 3*B*a*c^2*d^2*f - 3*A*b*c^2*d^2*f + 3*B*a*b^2*d*f^2 + A*b^3*d*f^2 + 3*B*a^2*c*d*f^2 + 6*A*a*
b*c*d*f^2 - B*a^3*f^3 - 3*A*a^2*b*f^3)*log(f*x^2 + d)/f^4 + 1/60*(10*B*c^3*f^5*x^6 + 36*B*b*c^2*f^5*x^5 + 12*A
*c^3*f^5*x^5 - 15*B*c^3*d*f^4*x^4 + 45*B*b^2*c*f^5*x^4 + 45*B*a*c^2*f^5*x^4 + 45*A*b*c^2*f^5*x^4 - 60*B*b*c^2*
d*f^4*x^3 - 20*A*c^3*d*f^4*x^3 + 20*B*b^3*f^5*x^3 + 120*B*a*b*c*f^5*x^3 + 60*A*b^2*c*f^5*x^3 + 60*A*a*c^2*f^5*
x^3 + 30*B*c^3*d^2*f^3*x^2 - 90*B*b^2*c*d*f^4*x^2 - 90*B*a*c^2*d*f^4*x^2 - 90*A*b*c^2*d*f^4*x^2 + 90*B*a*b^2*f
^5*x^2 + 30*A*b^3*f^5*x^2 + 90*B*a^2*c*f^5*x^2 + 180*A*a*b*c*f^5*x^2 + 180*B*b*c^2*d^2*f^3*x + 60*A*c^3*d^2*f^
3*x - 60*B*b^3*d*f^4*x - 360*B*a*b*c*d*f^4*x - 180*A*b^2*c*d*f^4*x - 180*A*a*c^2*d*f^4*x + 180*B*a^2*b*f^5*x +
 180*A*a*b^2*f^5*x + 180*A*a^2*c*f^5*x)/f^6

________________________________________________________________________________________

maple [A]  time = 0.01, size = 822, normalized size = 1.86 \[ \frac {B \,c^{3} x^{6}}{6 f}+\frac {A \,c^{3} x^{5}}{5 f}+\frac {3 B b \,c^{2} x^{5}}{5 f}+\frac {3 A b \,c^{2} x^{4}}{4 f}+\frac {3 B a \,c^{2} x^{4}}{4 f}+\frac {3 B \,b^{2} c \,x^{4}}{4 f}-\frac {B \,c^{3} d \,x^{4}}{4 f^{2}}+\frac {A a \,c^{2} x^{3}}{f}+\frac {A \,b^{2} c \,x^{3}}{f}-\frac {A \,c^{3} d \,x^{3}}{3 f^{2}}+\frac {2 B a b c \,x^{3}}{f}+\frac {B \,b^{3} x^{3}}{3 f}-\frac {B b \,c^{2} d \,x^{3}}{f^{2}}+\frac {A \,a^{3} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}}-\frac {3 A \,a^{2} c d \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f}-\frac {3 A a \,b^{2} d \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f}+\frac {3 A a b c \,x^{2}}{f}+\frac {3 A a \,c^{2} d^{2} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f^{2}}+\frac {A \,b^{3} x^{2}}{2 f}+\frac {3 A \,b^{2} c \,d^{2} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f^{2}}-\frac {3 A b \,c^{2} d \,x^{2}}{2 f^{2}}-\frac {A \,c^{3} d^{3} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f^{3}}-\frac {3 B \,a^{2} b d \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f}+\frac {3 B \,a^{2} c \,x^{2}}{2 f}+\frac {3 B a \,b^{2} x^{2}}{2 f}+\frac {6 B a b c \,d^{2} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f^{2}}-\frac {3 B a \,c^{2} d \,x^{2}}{2 f^{2}}+\frac {B \,b^{3} d^{2} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f^{2}}-\frac {3 B \,b^{2} c d \,x^{2}}{2 f^{2}}-\frac {3 B b \,c^{2} d^{3} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f^{3}}+\frac {B \,c^{3} d^{2} x^{2}}{2 f^{3}}+\frac {3 A \,a^{2} b \ln \left (f \,x^{2}+d \right )}{2 f}+\frac {3 A \,a^{2} c x}{f}+\frac {3 A a \,b^{2} x}{f}-\frac {3 A a b c d \ln \left (f \,x^{2}+d \right )}{f^{2}}-\frac {3 A a \,c^{2} d x}{f^{2}}-\frac {A \,b^{3} d \ln \left (f \,x^{2}+d \right )}{2 f^{2}}-\frac {3 A \,b^{2} c d x}{f^{2}}+\frac {3 A b \,c^{2} d^{2} \ln \left (f \,x^{2}+d \right )}{2 f^{3}}+\frac {A \,c^{3} d^{2} x}{f^{3}}+\frac {B \,a^{3} \ln \left (f \,x^{2}+d \right )}{2 f}+\frac {3 B \,a^{2} b x}{f}-\frac {3 B \,a^{2} c d \ln \left (f \,x^{2}+d \right )}{2 f^{2}}-\frac {3 B a \,b^{2} d \ln \left (f \,x^{2}+d \right )}{2 f^{2}}-\frac {6 B a b c d x}{f^{2}}+\frac {3 B a \,c^{2} d^{2} \ln \left (f \,x^{2}+d \right )}{2 f^{3}}-\frac {B \,b^{3} d x}{f^{2}}+\frac {3 B \,b^{2} c \,d^{2} \ln \left (f \,x^{2}+d \right )}{2 f^{3}}+\frac {3 B b \,c^{2} d^{2} x}{f^{3}}-\frac {B \,c^{3} d^{3} \ln \left (f \,x^{2}+d \right )}{2 f^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*(c*x^2+b*x+a)^3/(f*x^2+d),x)

[Out]

6/f^2/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*B*a*b*c*d^2-1/f^2*b^3*B*d*x+3/f*A*a*b^2*x+1/6*B*c^3*x^6/f-3/2/f^2*
ln(f*x^2+d)*B*a^2*c*d-3/2/f^2*ln(f*x^2+d)*B*a*b^2*d+3/2/f^3*ln(f*x^2+d)*B*a*c^2*d^2+3/2/f^3*ln(f*x^2+d)*B*b^2*
c*d^2-1/f^3/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*A*c^3*d^3+1/f^2/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*b^3*B*
d^2+3/f^3*B*b*c^2*d^2*x+2/f*B*x^3*a*b*c-1/f^2*B*x^3*b*c^2*d+3/f*A*x^2*a*b*c-3/2/f^2*A*x^2*b*c^2*d-3/2/f^2*B*x^
2*a*c^2*d-3/2/f^2*B*x^2*b^2*c*d-3/f^2*A*a*c^2*d*x-3/f^2*A*b^2*c*d*x+3/2/f^3*ln(f*x^2+d)*A*b*c^2*d^2+1/2/f*ln(f
*x^2+d)*B*a^3+1/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*A*a^3+1/3/f*B*x^3*b^3+1/2/f*A*x^2*b^3+1/5/f*A*x^5*c^3-3/
f^2*ln(f*x^2+d)*A*a*b*c*d-3/f/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*A*a^2*c*d-3/f/(d*f)^(1/2)*arctan(1/(d*f)^(
1/2)*f*x)*A*a*b^2*d+3/f^2/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*A*a*c^2*d^2+3/f^2/(d*f)^(1/2)*arctan(1/(d*f)^(
1/2)*f*x)*A*b^2*c*d^2-3/f/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*B*a^2*b*d-3/f^3/(d*f)^(1/2)*arctan(1/(d*f)^(1/
2)*f*x)*B*b*c^2*d^3-6/f^2*B*a*b*c*d*x+3/5/f*B*x^5*b*c^2+3/4/f*A*x^4*b*c^2+1/f*A*x^3*a*c^2+3/2/f*ln(f*x^2+d)*A*
a^2*b-1/2/f^2*ln(f*x^2+d)*A*b^3*d-1/2/f^4*ln(f*x^2+d)*B*c^3*d^3+1/f*A*x^3*b^2*c+1/2/f^3*B*x^2*c^3*d^2+1/f^3*A*
c^3*d^2*x+3/f*B*a^2*b*x-1/3/f^2*A*x^3*c^3*d+3/2/f*B*x^2*a^2*c+3/2/f*B*x^2*a*b^2+3/f*A*a^2*c*x+3/4/f*B*x^4*a*c^
2+3/4/f*B*x^4*b^2*c-1/4/f^2*B*x^4*c^3*d

________________________________________________________________________________________

maxima [A]  time = 0.99, size = 471, normalized size = 1.07 \[ \frac {{\left (A a^{3} f^{3} - {\left (3 \, B b c^{2} + A c^{3}\right )} d^{3} + {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} d^{2} f - 3 \, {\left (B a^{2} b + A a b^{2} + A a^{2} c\right )} d f^{2}\right )} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f} f^{3}} + \frac {10 \, B c^{3} f^{2} x^{6} + 12 \, {\left (3 \, B b c^{2} + A c^{3}\right )} f^{2} x^{5} - 15 \, {\left (B c^{3} d f - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} f^{2}\right )} x^{4} - 20 \, {\left ({\left (3 \, B b c^{2} + A c^{3}\right )} d f - {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} f^{2}\right )} x^{3} + 30 \, {\left (B c^{3} d^{2} - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} d f + {\left (3 \, B a b^{2} + A b^{3} + 3 \, {\left (B a^{2} + 2 \, A a b\right )} c\right )} f^{2}\right )} x^{2} + 60 \, {\left ({\left (3 \, B b c^{2} + A c^{3}\right )} d^{2} - {\left (B b^{3} + 3 \, A a c^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} d f + 3 \, {\left (B a^{2} b + A a b^{2} + A a^{2} c\right )} f^{2}\right )} x}{60 \, f^{3}} - \frac {{\left (B c^{3} d^{3} - 3 \, {\left (B b^{2} c + {\left (B a + A b\right )} c^{2}\right )} d^{2} f + {\left (3 \, B a b^{2} + A b^{3} + 3 \, {\left (B a^{2} + 2 \, A a b\right )} c\right )} d f^{2} - {\left (B a^{3} + 3 \, A a^{2} b\right )} f^{3}\right )} \log \left (f x^{2} + d\right )}{2 \, f^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^3/(f*x^2+d),x, algorithm="maxima")

[Out]

(A*a^3*f^3 - (3*B*b*c^2 + A*c^3)*d^3 + (B*b^3 + 3*A*a*c^2 + 3*(2*B*a*b + A*b^2)*c)*d^2*f - 3*(B*a^2*b + A*a*b^
2 + A*a^2*c)*d*f^2)*arctan(f*x/sqrt(d*f))/(sqrt(d*f)*f^3) + 1/60*(10*B*c^3*f^2*x^6 + 12*(3*B*b*c^2 + A*c^3)*f^
2*x^5 - 15*(B*c^3*d*f - 3*(B*b^2*c + (B*a + A*b)*c^2)*f^2)*x^4 - 20*((3*B*b*c^2 + A*c^3)*d*f - (B*b^3 + 3*A*a*
c^2 + 3*(2*B*a*b + A*b^2)*c)*f^2)*x^3 + 30*(B*c^3*d^2 - 3*(B*b^2*c + (B*a + A*b)*c^2)*d*f + (3*B*a*b^2 + A*b^3
 + 3*(B*a^2 + 2*A*a*b)*c)*f^2)*x^2 + 60*((3*B*b*c^2 + A*c^3)*d^2 - (B*b^3 + 3*A*a*c^2 + 3*(2*B*a*b + A*b^2)*c)
*d*f + 3*(B*a^2*b + A*a*b^2 + A*a^2*c)*f^2)*x)/f^3 - 1/2*(B*c^3*d^3 - 3*(B*b^2*c + (B*a + A*b)*c^2)*d^2*f + (3
*B*a*b^2 + A*b^3 + 3*(B*a^2 + 2*A*a*b)*c)*d*f^2 - (B*a^3 + 3*A*a^2*b)*f^3)*log(f*x^2 + d)/f^4

________________________________________________________________________________________

mupad [B]  time = 3.79, size = 552, normalized size = 1.25 \[ x^2\,\left (\frac {3\,B\,c\,a^2+3\,B\,a\,b^2+6\,A\,c\,a\,b+A\,b^3}{2\,f}-\frac {d\,\left (\frac {3\,B\,b^2\,c+3\,A\,b\,c^2+3\,B\,a\,c^2}{f}-\frac {B\,c^3\,d}{f^2}\right )}{2\,f}\right )+x\,\left (\frac {3\,B\,a^2\,b+3\,A\,c\,a^2+3\,A\,a\,b^2}{f}-\frac {d\,\left (\frac {B\,b^3+3\,A\,b^2\,c+6\,B\,a\,b\,c+3\,A\,a\,c^2}{f}-\frac {d\,\left (A\,c^3+3\,B\,b\,c^2\right )}{f^2}\right )}{f}\right )+x^3\,\left (\frac {B\,b^3+3\,A\,b^2\,c+6\,B\,a\,b\,c+3\,A\,a\,c^2}{3\,f}-\frac {d\,\left (A\,c^3+3\,B\,b\,c^2\right )}{3\,f^2}\right )+x^4\,\left (\frac {3\,B\,b^2\,c+3\,A\,b\,c^2+3\,B\,a\,c^2}{4\,f}-\frac {B\,c^3\,d}{4\,f^2}\right )+\frac {x^5\,\left (A\,c^3+3\,B\,b\,c^2\right )}{5\,f}+\frac {B\,c^3\,x^6}{6\,f}+\frac {\ln \left (f\,x^2+d\right )\,\left (4\,B\,a^3\,d\,f^7+12\,A\,a^2\,b\,d\,f^7-12\,B\,a^2\,c\,d^2\,f^6-12\,B\,a\,b^2\,d^2\,f^6-24\,A\,a\,b\,c\,d^2\,f^6+12\,B\,a\,c^2\,d^3\,f^5-4\,A\,b^3\,d^2\,f^6+12\,B\,b^2\,c\,d^3\,f^5+12\,A\,b\,c^2\,d^3\,f^5-4\,B\,c^3\,d^4\,f^4\right )}{8\,d\,f^8}+\frac {\mathrm {atan}\left (\frac {\sqrt {f}\,x}{\sqrt {d}}\right )\,\left (A\,a^3\,f^3-3\,B\,a^2\,b\,d\,f^2-3\,A\,a^2\,c\,d\,f^2-3\,A\,a\,b^2\,d\,f^2+6\,B\,a\,b\,c\,d^2\,f+3\,A\,a\,c^2\,d^2\,f+B\,b^3\,d^2\,f+3\,A\,b^2\,c\,d^2\,f-3\,B\,b\,c^2\,d^3-A\,c^3\,d^3\right )}{\sqrt {d}\,f^{7/2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x + c*x^2)^3)/(d + f*x^2),x)

[Out]

x^2*((A*b^3 + 3*B*a*b^2 + 3*B*a^2*c + 6*A*a*b*c)/(2*f) - (d*((3*A*b*c^2 + 3*B*a*c^2 + 3*B*b^2*c)/f - (B*c^3*d)
/f^2))/(2*f)) + x*((3*A*a*b^2 + 3*A*a^2*c + 3*B*a^2*b)/f - (d*((B*b^3 + 3*A*a*c^2 + 3*A*b^2*c + 6*B*a*b*c)/f -
 (d*(A*c^3 + 3*B*b*c^2))/f^2))/f) + x^3*((B*b^3 + 3*A*a*c^2 + 3*A*b^2*c + 6*B*a*b*c)/(3*f) - (d*(A*c^3 + 3*B*b
*c^2))/(3*f^2)) + x^4*((3*A*b*c^2 + 3*B*a*c^2 + 3*B*b^2*c)/(4*f) - (B*c^3*d)/(4*f^2)) + (x^5*(A*c^3 + 3*B*b*c^
2))/(5*f) + (B*c^3*x^6)/(6*f) + (log(d + f*x^2)*(4*B*a^3*d*f^7 - 4*A*b^3*d^2*f^6 - 4*B*c^3*d^4*f^4 - 12*B*a*b^
2*d^2*f^6 + 12*A*b*c^2*d^3*f^5 + 12*B*a*c^2*d^3*f^5 - 12*B*a^2*c*d^2*f^6 + 12*B*b^2*c*d^3*f^5 + 12*A*a^2*b*d*f
^7 - 24*A*a*b*c*d^2*f^6))/(8*d*f^8) + (atan((f^(1/2)*x)/d^(1/2))*(A*a^3*f^3 - A*c^3*d^3 - 3*B*b*c^2*d^3 + B*b^
3*d^2*f - 3*A*a*b^2*d*f^2 + 3*A*a*c^2*d^2*f - 3*A*a^2*c*d*f^2 - 3*B*a^2*b*d*f^2 + 3*A*b^2*c*d^2*f + 6*B*a*b*c*
d^2*f))/(d^(1/2)*f^(7/2))

________________________________________________________________________________________

sympy [B]  time = 23.62, size = 1962, normalized size = 4.45 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x**2+b*x+a)**3/(f*x**2+d),x)

[Out]

B*c**3*x**6/(6*f) + x**5*(A*c**3/(5*f) + 3*B*b*c**2/(5*f)) + x**4*(3*A*b*c**2/(4*f) + 3*B*a*c**2/(4*f) + 3*B*b
**2*c/(4*f) - B*c**3*d/(4*f**2)) + x**3*(A*a*c**2/f + A*b**2*c/f - A*c**3*d/(3*f**2) + 2*B*a*b*c/f + B*b**3/(3
*f) - B*b*c**2*d/f**2) + x**2*(3*A*a*b*c/f + A*b**3/(2*f) - 3*A*b*c**2*d/(2*f**2) + 3*B*a**2*c/(2*f) + 3*B*a*b
**2/(2*f) - 3*B*a*c**2*d/(2*f**2) - 3*B*b**2*c*d/(2*f**2) + B*c**3*d**2/(2*f**3)) + x*(3*A*a**2*c/f + 3*A*a*b*
*2/f - 3*A*a*c**2*d/f**2 - 3*A*b**2*c*d/f**2 + A*c**3*d**2/f**3 + 3*B*a**2*b/f - 6*B*a*b*c*d/f**2 - B*b**3*d/f
**2 + 3*B*b*c**2*d**2/f**3) + ((3*A*a**2*b*f**3 - 6*A*a*b*c*d*f**2 - A*b**3*d*f**2 + 3*A*b*c**2*d**2*f + B*a**
3*f**3 - 3*B*a**2*c*d*f**2 - 3*B*a*b**2*d*f**2 + 3*B*a*c**2*d**2*f + 3*B*b**2*c*d**2*f - B*c**3*d**3)/(2*f**4)
 - sqrt(-d*f**9)*(A*a**3*f**3 - 3*A*a**2*c*d*f**2 - 3*A*a*b**2*d*f**2 + 3*A*a*c**2*d**2*f + 3*A*b**2*c*d**2*f
- A*c**3*d**3 - 3*B*a**2*b*d*f**2 + 6*B*a*b*c*d**2*f + B*b**3*d**2*f - 3*B*b*c**2*d**3)/(2*d*f**8))*log(x + (-
3*A*a**2*b*d*f**3 + 6*A*a*b*c*d**2*f**2 + A*b**3*d**2*f**2 - 3*A*b*c**2*d**3*f - B*a**3*d*f**3 + 3*B*a**2*c*d*
*2*f**2 + 3*B*a*b**2*d**2*f**2 - 3*B*a*c**2*d**3*f - 3*B*b**2*c*d**3*f + B*c**3*d**4 + 2*d*f**4*((3*A*a**2*b*f
**3 - 6*A*a*b*c*d*f**2 - A*b**3*d*f**2 + 3*A*b*c**2*d**2*f + B*a**3*f**3 - 3*B*a**2*c*d*f**2 - 3*B*a*b**2*d*f*
*2 + 3*B*a*c**2*d**2*f + 3*B*b**2*c*d**2*f - B*c**3*d**3)/(2*f**4) - sqrt(-d*f**9)*(A*a**3*f**3 - 3*A*a**2*c*d
*f**2 - 3*A*a*b**2*d*f**2 + 3*A*a*c**2*d**2*f + 3*A*b**2*c*d**2*f - A*c**3*d**3 - 3*B*a**2*b*d*f**2 + 6*B*a*b*
c*d**2*f + B*b**3*d**2*f - 3*B*b*c**2*d**3)/(2*d*f**8)))/(A*a**3*f**4 - 3*A*a**2*c*d*f**3 - 3*A*a*b**2*d*f**3
+ 3*A*a*c**2*d**2*f**2 + 3*A*b**2*c*d**2*f**2 - A*c**3*d**3*f - 3*B*a**2*b*d*f**3 + 6*B*a*b*c*d**2*f**2 + B*b*
*3*d**2*f**2 - 3*B*b*c**2*d**3*f)) + ((3*A*a**2*b*f**3 - 6*A*a*b*c*d*f**2 - A*b**3*d*f**2 + 3*A*b*c**2*d**2*f
+ B*a**3*f**3 - 3*B*a**2*c*d*f**2 - 3*B*a*b**2*d*f**2 + 3*B*a*c**2*d**2*f + 3*B*b**2*c*d**2*f - B*c**3*d**3)/(
2*f**4) + sqrt(-d*f**9)*(A*a**3*f**3 - 3*A*a**2*c*d*f**2 - 3*A*a*b**2*d*f**2 + 3*A*a*c**2*d**2*f + 3*A*b**2*c*
d**2*f - A*c**3*d**3 - 3*B*a**2*b*d*f**2 + 6*B*a*b*c*d**2*f + B*b**3*d**2*f - 3*B*b*c**2*d**3)/(2*d*f**8))*log
(x + (-3*A*a**2*b*d*f**3 + 6*A*a*b*c*d**2*f**2 + A*b**3*d**2*f**2 - 3*A*b*c**2*d**3*f - B*a**3*d*f**3 + 3*B*a*
*2*c*d**2*f**2 + 3*B*a*b**2*d**2*f**2 - 3*B*a*c**2*d**3*f - 3*B*b**2*c*d**3*f + B*c**3*d**4 + 2*d*f**4*((3*A*a
**2*b*f**3 - 6*A*a*b*c*d*f**2 - A*b**3*d*f**2 + 3*A*b*c**2*d**2*f + B*a**3*f**3 - 3*B*a**2*c*d*f**2 - 3*B*a*b*
*2*d*f**2 + 3*B*a*c**2*d**2*f + 3*B*b**2*c*d**2*f - B*c**3*d**3)/(2*f**4) + sqrt(-d*f**9)*(A*a**3*f**3 - 3*A*a
**2*c*d*f**2 - 3*A*a*b**2*d*f**2 + 3*A*a*c**2*d**2*f + 3*A*b**2*c*d**2*f - A*c**3*d**3 - 3*B*a**2*b*d*f**2 + 6
*B*a*b*c*d**2*f + B*b**3*d**2*f - 3*B*b*c**2*d**3)/(2*d*f**8)))/(A*a**3*f**4 - 3*A*a**2*c*d*f**3 - 3*A*a*b**2*
d*f**3 + 3*A*a*c**2*d**2*f**2 + 3*A*b**2*c*d**2*f**2 - A*c**3*d**3*f - 3*B*a**2*b*d*f**3 + 6*B*a*b*c*d**2*f**2
 + B*b**3*d**2*f**2 - 3*B*b*c**2*d**3*f))

________________________________________________________________________________________